﻿@model PaginationVm
<div class="pagination"></div>
<div class="paging">
    <div class="pages">
        <ul class="fenye" id="page2">
            @if (Model.IsPreviousPage)
            {
                <li><a href="/ChanUI/Index?index=@(Model.ChanIndex)&id=@(Model.ChannelId)&pageIndex=1" class="firstpage">首页</a></li>
                <li><a href="/ChanUI/Index?index=@(Model.ChanIndex)&id=@(Model.ChannelId)&pageIndex=@(Model.PageNo-1)" class="prevpage">上一页</a></li>
            }
            else
            {
                 <li><a href="javascript:;" class="firstpage">首页</a></li>
                <li><a href="javascript:;" class="prevpage">上一页</a></li>
            }
            
            @if(Model.NumPage.Any()){
                foreach (var item in Model.NumPage)
                {
                    if (item==Model.PageNo)
                    {
                        <li><a href="javascript:;" class="curpage">@item</a></li>
                    }
                    else
                    {
                        <li><a href="/ChanUI/Index?index=@(Model.ChanIndex)&id=@(Model.ChannelId)&pageIndex=@(item)" class="pagenum">@item</a></li>
                    }
                }
            }
            @if (Model.IsNextPage)
            {
                <li><a href="/ChanUI/Index?index=@(Model.ChanIndex)&id=@(Model.ChannelId)&pageIndex=@(Model.PageNo+1)" class="nextpage">下一页</a></li>
                <li><a href="/ChanUI/Index?index=@(Model.ChanIndex)&id=@(Model.ChannelId)&pageIndex=@Model.TotalPage" class="lastpage">末页</a></li>
            }
            else
            {
                <li><a href="javascript:;" class="nextpage">下一页</a></li>
                <li><a href="javascript:;"  class="lastpage">末页</a></li>
            }
        </ul>
    </div>
</div>